package com.rockcent.mall.helper;


import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.common.utils.RDigestUtils;
import com.rockcent.mall.lib.domain.*;
import com.rockcent.mall.lib.domain.enumclass.GiftPacketStatus;
import com.rockcent.mall.lib.domain.enumclass.MallProductAuditStatus;
import com.rockcent.mall.lib.domain.enumclass.ProductMerchantStoreType;
import com.rockcent.mall.lib.domain.enumclass.ProductStatus;
import com.rockcent.mall.lib.dto.ProductDto;
import com.rockcent.mall.lib.repository.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.spi.LoggerFactory;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;

/**
 * Created by oyhk on 16/3/3.
 */
@Component("apiProductHelper")
public class ProductHelper {

    private Logger log = Logger.getLogger(ProductHelper.class);



    /**
     * 产品的唯一识别码 随机数 + timestamps 然后 md5
     *
     * @return
     */
    public String createIdentifier() throws Exception {
        return RDigestUtils.md5Hex(new Random().nextInt() + "" + new Date().getTime());
    }

}
